\(\int \frac {(e+f x)^2 \text {sech}^2(c+d x)}{a+i a \sinh (c+d x)} \, dx\) [278]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [F]
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 31, antiderivative size = 325 \[ \int \frac {(e+f x)^2 \text {sech}^2(c+d x)}{a+i a \sinh (c+d x)} \, dx=\frac {2 (e+f x)^2}{3 a d}-\frac {2 i f (e+f x) \arctan \left (e^{c+d x}\right )}{3 a d^2}-\frac {4 f (e+f x) \log \left (1+e^{2 (c+d x)}\right )}{3 a d^2}-\frac {f^2 \operatorname {PolyLog}\left (2,-i e^{c+d x}\right )}{3 a d^3}+\frac {f^2 \operatorname {PolyLog}\left (2,i e^{c+d x}\right )}{3 a d^3}-\frac {2 f^2 \operatorname {PolyLog}\left (2,-e^{2 (c+d x)}\right )}{3 a d^3}-\frac {i f^2 \text {sech}(c+d x)}{3 a d^3}+\frac {f (e+f x) \text {sech}^2(c+d x)}{3 a d^2}+\frac {i (e+f x)^2 \text {sech}^3(c+d x)}{3 a d}-\frac {f^2 \tanh (c+d x)}{3 a d^3}+\frac {2 (e+f x)^2 \tanh (c+d x)}{3 a d}-\frac {i f (e+f x) \text {sech}(c+d x) \tanh (c+d x)}{3 a d^2}+\frac {(e+f x)^2 \text {sech}^2(c+d x) \tanh (c+d x)}{3 a d} \]

[Out]

2/3*(f*x+e)^2/a/d-2/3*I*f*(f*x+e)*arctan(exp(d*x+c))/a/d^2-4/3*f*(f*x+e)*ln(1+exp(2*d*x+2*c))/a/d^2-1/3*f^2*po
lylog(2,-I*exp(d*x+c))/a/d^3+1/3*f^2*polylog(2,I*exp(d*x+c))/a/d^3-2/3*f^2*polylog(2,-exp(2*d*x+2*c))/a/d^3-1/
3*I*f^2*sech(d*x+c)/a/d^3+1/3*f*(f*x+e)*sech(d*x+c)^2/a/d^2+1/3*I*(f*x+e)^2*sech(d*x+c)^3/a/d-1/3*f^2*tanh(d*x
+c)/a/d^3+2/3*(f*x+e)^2*tanh(d*x+c)/a/d-1/3*I*f*(f*x+e)*sech(d*x+c)*tanh(d*x+c)/a/d^2+1/3*(f*x+e)^2*sech(d*x+c
)^2*tanh(d*x+c)/a/d

Rubi [A] (verified)

Time = 0.28 (sec) , antiderivative size = 325, normalized size of antiderivative = 1.00, number of steps used = 16, number of rules used = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.387, Rules used = {5690, 4271, 3852, 8, 4269, 3799, 2221, 2317, 2438, 5559, 4270, 4265} \[ \int \frac {(e+f x)^2 \text {sech}^2(c+d x)}{a+i a \sinh (c+d x)} \, dx=-\frac {2 i f (e+f x) \arctan \left (e^{c+d x}\right )}{3 a d^2}-\frac {f^2 \operatorname {PolyLog}\left (2,-i e^{c+d x}\right )}{3 a d^3}+\frac {f^2 \operatorname {PolyLog}\left (2,i e^{c+d x}\right )}{3 a d^3}-\frac {2 f^2 \operatorname {PolyLog}\left (2,-e^{2 (c+d x)}\right )}{3 a d^3}-\frac {f^2 \tanh (c+d x)}{3 a d^3}-\frac {i f^2 \text {sech}(c+d x)}{3 a d^3}-\frac {4 f (e+f x) \log \left (e^{2 (c+d x)}+1\right )}{3 a d^2}+\frac {f (e+f x) \text {sech}^2(c+d x)}{3 a d^2}-\frac {i f (e+f x) \tanh (c+d x) \text {sech}(c+d x)}{3 a d^2}+\frac {2 (e+f x)^2 \tanh (c+d x)}{3 a d}+\frac {i (e+f x)^2 \text {sech}^3(c+d x)}{3 a d}+\frac {(e+f x)^2 \tanh (c+d x) \text {sech}^2(c+d x)}{3 a d}+\frac {2 (e+f x)^2}{3 a d} \]

[In]

Int[((e + f*x)^2*Sech[c + d*x]^2)/(a + I*a*Sinh[c + d*x]),x]

[Out]

(2*(e + f*x)^2)/(3*a*d) - (((2*I)/3)*f*(e + f*x)*ArcTan[E^(c + d*x)])/(a*d^2) - (4*f*(e + f*x)*Log[1 + E^(2*(c
 + d*x))])/(3*a*d^2) - (f^2*PolyLog[2, (-I)*E^(c + d*x)])/(3*a*d^3) + (f^2*PolyLog[2, I*E^(c + d*x)])/(3*a*d^3
) - (2*f^2*PolyLog[2, -E^(2*(c + d*x))])/(3*a*d^3) - ((I/3)*f^2*Sech[c + d*x])/(a*d^3) + (f*(e + f*x)*Sech[c +
 d*x]^2)/(3*a*d^2) + ((I/3)*(e + f*x)^2*Sech[c + d*x]^3)/(a*d) - (f^2*Tanh[c + d*x])/(3*a*d^3) + (2*(e + f*x)^
2*Tanh[c + d*x])/(3*a*d) - ((I/3)*f*(e + f*x)*Sech[c + d*x]*Tanh[c + d*x])/(a*d^2) + ((e + f*x)^2*Sech[c + d*x
]^2*Tanh[c + d*x])/(3*a*d)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 2221

Int[(((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.))/((a_) + (b_.)*((F_)^((g_.)*((e_.) +
 (f_.)*(x_))))^(n_.)), x_Symbol] :> Simp[((c + d*x)^m/(b*f*g*n*Log[F]))*Log[1 + b*((F^(g*(e + f*x)))^n/a)], x]
 - Dist[d*(m/(b*f*g*n*Log[F])), Int[(c + d*x)^(m - 1)*Log[1 + b*((F^(g*(e + f*x)))^n/a)], x], x] /; FreeQ[{F,
a, b, c, d, e, f, g, n}, x] && IGtQ[m, 0]

Rule 2317

Int[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] :> Dist[1/(d*e*n*Log[F]), Subst[Int
[Log[a + b*x]/x, x], x, (F^(e*(c + d*x)))^n], x] /; FreeQ[{F, a, b, c, d, e, n}, x] && GtQ[a, 0]

Rule 2438

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> Simp[-PolyLog[2, (-c)*e*x^n]/n, x] /; FreeQ[{c, d,
 e, n}, x] && EqQ[c*d, 1]

Rule 3799

Int[((c_.) + (d_.)*(x_))^(m_.)*tan[(e_.) + (Complex[0, fz_])*(f_.)*(x_)], x_Symbol] :> Simp[(-I)*((c + d*x)^(m
 + 1)/(d*(m + 1))), x] + Dist[2*I, Int[(c + d*x)^m*(E^(2*((-I)*e + f*fz*x))/(1 + E^(2*((-I)*e + f*fz*x)))), x]
, x] /; FreeQ[{c, d, e, f, fz}, x] && IGtQ[m, 0]

Rule 3852

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Dist[-d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rule 4265

Int[csc[(e_.) + Pi*(k_.) + (Complex[0, fz_])*(f_.)*(x_)]*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[-2*(c +
 d*x)^m*(ArcTanh[E^((-I)*e + f*fz*x)/E^(I*k*Pi)]/(f*fz*I)), x] + (-Dist[d*(m/(f*fz*I)), Int[(c + d*x)^(m - 1)*
Log[1 - E^((-I)*e + f*fz*x)/E^(I*k*Pi)], x], x] + Dist[d*(m/(f*fz*I)), Int[(c + d*x)^(m - 1)*Log[1 + E^((-I)*e
 + f*fz*x)/E^(I*k*Pi)], x], x]) /; FreeQ[{c, d, e, f, fz}, x] && IntegerQ[2*k] && IGtQ[m, 0]

Rule 4269

Int[csc[(e_.) + (f_.)*(x_)]^2*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[(-(c + d*x)^m)*(Cot[e + f*x]/f), x
] + Dist[d*(m/f), Int[(c + d*x)^(m - 1)*Cot[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]

Rule 4270

Int[(csc[(e_.) + (f_.)*(x_)]*(b_.))^(n_)*((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[(-b^2)*(c + d*x)*Cot[e + f*x]
*((b*Csc[e + f*x])^(n - 2)/(f*(n - 1))), x] + (Dist[b^2*((n - 2)/(n - 1)), Int[(c + d*x)*(b*Csc[e + f*x])^(n -
 2), x], x] - Simp[b^2*d*((b*Csc[e + f*x])^(n - 2)/(f^2*(n - 1)*(n - 2))), x]) /; FreeQ[{b, c, d, e, f}, x] &&
 GtQ[n, 1] && NeQ[n, 2]

Rule 4271

Int[(csc[(e_.) + (f_.)*(x_)]*(b_.))^(n_)*((c_.) + (d_.)*(x_))^(m_), x_Symbol] :> Simp[(-b^2)*(c + d*x)^m*Cot[e
 + f*x]*((b*Csc[e + f*x])^(n - 2)/(f*(n - 1))), x] + (Dist[b^2*d^2*m*((m - 1)/(f^2*(n - 1)*(n - 2))), Int[(c +
 d*x)^(m - 2)*(b*Csc[e + f*x])^(n - 2), x], x] + Dist[b^2*((n - 2)/(n - 1)), Int[(c + d*x)^m*(b*Csc[e + f*x])^
(n - 2), x], x] - Simp[b^2*d*m*(c + d*x)^(m - 1)*((b*Csc[e + f*x])^(n - 2)/(f^2*(n - 1)*(n - 2))), x]) /; Free
Q[{b, c, d, e, f}, x] && GtQ[n, 1] && NeQ[n, 2] && GtQ[m, 1]

Rule 5559

Int[((c_.) + (d_.)*(x_))^(m_.)*Sech[(a_.) + (b_.)*(x_)]^(n_.)*Tanh[(a_.) + (b_.)*(x_)]^(p_.), x_Symbol] :> Sim
p[(-(c + d*x)^m)*(Sech[a + b*x]^n/(b*n)), x] + Dist[d*(m/(b*n)), Int[(c + d*x)^(m - 1)*Sech[a + b*x]^n, x], x]
 /; FreeQ[{a, b, c, d, n}, x] && EqQ[p, 1] && GtQ[m, 0]

Rule 5690

Int[(((e_.) + (f_.)*(x_))^(m_.)*Sech[(c_.) + (d_.)*(x_)]^(n_.))/((a_) + (b_.)*Sinh[(c_.) + (d_.)*(x_)]), x_Sym
bol] :> Dist[1/a, Int[(e + f*x)^m*Sech[c + d*x]^(n + 2), x], x] + Dist[1/b, Int[(e + f*x)^m*Sech[c + d*x]^(n +
 1)*Tanh[c + d*x], x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && IGtQ[m, 0] && EqQ[a^2 + b^2, 0]

Rubi steps \begin{align*} \text {integral}& = -\frac {i \int (e+f x)^2 \text {sech}^3(c+d x) \tanh (c+d x) \, dx}{a}+\frac {\int (e+f x)^2 \text {sech}^4(c+d x) \, dx}{a} \\ & = \frac {f (e+f x) \text {sech}^2(c+d x)}{3 a d^2}+\frac {i (e+f x)^2 \text {sech}^3(c+d x)}{3 a d}+\frac {(e+f x)^2 \text {sech}^2(c+d x) \tanh (c+d x)}{3 a d}+\frac {2 \int (e+f x)^2 \text {sech}^2(c+d x) \, dx}{3 a}-\frac {(2 i f) \int (e+f x) \text {sech}^3(c+d x) \, dx}{3 a d}-\frac {f^2 \int \text {sech}^2(c+d x) \, dx}{3 a d^2} \\ & = -\frac {i f^2 \text {sech}(c+d x)}{3 a d^3}+\frac {f (e+f x) \text {sech}^2(c+d x)}{3 a d^2}+\frac {i (e+f x)^2 \text {sech}^3(c+d x)}{3 a d}+\frac {2 (e+f x)^2 \tanh (c+d x)}{3 a d}-\frac {i f (e+f x) \text {sech}(c+d x) \tanh (c+d x)}{3 a d^2}+\frac {(e+f x)^2 \text {sech}^2(c+d x) \tanh (c+d x)}{3 a d}-\frac {(i f) \int (e+f x) \text {sech}(c+d x) \, dx}{3 a d}-\frac {(4 f) \int (e+f x) \tanh (c+d x) \, dx}{3 a d}-\frac {\left (i f^2\right ) \text {Subst}(\int 1 \, dx,x,-i \tanh (c+d x))}{3 a d^3} \\ & = \frac {2 (e+f x)^2}{3 a d}-\frac {2 i f (e+f x) \arctan \left (e^{c+d x}\right )}{3 a d^2}-\frac {i f^2 \text {sech}(c+d x)}{3 a d^3}+\frac {f (e+f x) \text {sech}^2(c+d x)}{3 a d^2}+\frac {i (e+f x)^2 \text {sech}^3(c+d x)}{3 a d}-\frac {f^2 \tanh (c+d x)}{3 a d^3}+\frac {2 (e+f x)^2 \tanh (c+d x)}{3 a d}-\frac {i f (e+f x) \text {sech}(c+d x) \tanh (c+d x)}{3 a d^2}+\frac {(e+f x)^2 \text {sech}^2(c+d x) \tanh (c+d x)}{3 a d}-\frac {(8 f) \int \frac {e^{2 (c+d x)} (e+f x)}{1+e^{2 (c+d x)}} \, dx}{3 a d}-\frac {f^2 \int \log \left (1-i e^{c+d x}\right ) \, dx}{3 a d^2}+\frac {f^2 \int \log \left (1+i e^{c+d x}\right ) \, dx}{3 a d^2} \\ & = \frac {2 (e+f x)^2}{3 a d}-\frac {2 i f (e+f x) \arctan \left (e^{c+d x}\right )}{3 a d^2}-\frac {4 f (e+f x) \log \left (1+e^{2 (c+d x)}\right )}{3 a d^2}-\frac {i f^2 \text {sech}(c+d x)}{3 a d^3}+\frac {f (e+f x) \text {sech}^2(c+d x)}{3 a d^2}+\frac {i (e+f x)^2 \text {sech}^3(c+d x)}{3 a d}-\frac {f^2 \tanh (c+d x)}{3 a d^3}+\frac {2 (e+f x)^2 \tanh (c+d x)}{3 a d}-\frac {i f (e+f x) \text {sech}(c+d x) \tanh (c+d x)}{3 a d^2}+\frac {(e+f x)^2 \text {sech}^2(c+d x) \tanh (c+d x)}{3 a d}-\frac {f^2 \text {Subst}\left (\int \frac {\log (1-i x)}{x} \, dx,x,e^{c+d x}\right )}{3 a d^3}+\frac {f^2 \text {Subst}\left (\int \frac {\log (1+i x)}{x} \, dx,x,e^{c+d x}\right )}{3 a d^3}+\frac {\left (4 f^2\right ) \int \log \left (1+e^{2 (c+d x)}\right ) \, dx}{3 a d^2} \\ & = \frac {2 (e+f x)^2}{3 a d}-\frac {2 i f (e+f x) \arctan \left (e^{c+d x}\right )}{3 a d^2}-\frac {4 f (e+f x) \log \left (1+e^{2 (c+d x)}\right )}{3 a d^2}-\frac {f^2 \operatorname {PolyLog}\left (2,-i e^{c+d x}\right )}{3 a d^3}+\frac {f^2 \operatorname {PolyLog}\left (2,i e^{c+d x}\right )}{3 a d^3}-\frac {i f^2 \text {sech}(c+d x)}{3 a d^3}+\frac {f (e+f x) \text {sech}^2(c+d x)}{3 a d^2}+\frac {i (e+f x)^2 \text {sech}^3(c+d x)}{3 a d}-\frac {f^2 \tanh (c+d x)}{3 a d^3}+\frac {2 (e+f x)^2 \tanh (c+d x)}{3 a d}-\frac {i f (e+f x) \text {sech}(c+d x) \tanh (c+d x)}{3 a d^2}+\frac {(e+f x)^2 \text {sech}^2(c+d x) \tanh (c+d x)}{3 a d}+\frac {\left (2 f^2\right ) \text {Subst}\left (\int \frac {\log (1+x)}{x} \, dx,x,e^{2 (c+d x)}\right )}{3 a d^3} \\ & = \frac {2 (e+f x)^2}{3 a d}-\frac {2 i f (e+f x) \arctan \left (e^{c+d x}\right )}{3 a d^2}-\frac {4 f (e+f x) \log \left (1+e^{2 (c+d x)}\right )}{3 a d^2}-\frac {f^2 \operatorname {PolyLog}\left (2,-i e^{c+d x}\right )}{3 a d^3}+\frac {f^2 \operatorname {PolyLog}\left (2,i e^{c+d x}\right )}{3 a d^3}-\frac {2 f^2 \operatorname {PolyLog}\left (2,-e^{2 (c+d x)}\right )}{3 a d^3}-\frac {i f^2 \text {sech}(c+d x)}{3 a d^3}+\frac {f (e+f x) \text {sech}^2(c+d x)}{3 a d^2}+\frac {i (e+f x)^2 \text {sech}^3(c+d x)}{3 a d}-\frac {f^2 \tanh (c+d x)}{3 a d^3}+\frac {2 (e+f x)^2 \tanh (c+d x)}{3 a d}-\frac {i f (e+f x) \text {sech}(c+d x) \tanh (c+d x)}{3 a d^2}+\frac {(e+f x)^2 \text {sech}^2(c+d x) \tanh (c+d x)}{3 a d} \\ \end{align*}

Mathematica [A] (verified)

Time = 4.61 (sec) , antiderivative size = 575, normalized size of antiderivative = 1.77 \[ \int \frac {(e+f x)^2 \text {sech}^2(c+d x)}{a+i a \sinh (c+d x)} \, dx=\frac {\frac {10 i d (e+f x) \left (d (e+f x)+2 \left (1+i e^c\right ) f \log \left (1-i e^{-c-d x}\right )\right )}{-i+e^c}+\frac {6 \left (d (e+f x) \left (d (e+f x)+2 \left (1-i e^c\right ) f \log \left (1+i e^{-c-d x}\right )\right )+2 i \left (i+e^c\right ) f^2 \operatorname {PolyLog}\left (2,-i e^{-c-d x}\right )\right )}{-1+i e^c}+20 f^2 \operatorname {PolyLog}\left (2,i e^{-c-d x}\right )+\frac {-2 i f^2 \cosh (c)+2 d f (e+f x) \cosh (d x)-2 i d^2 e^2 \cosh (c+d x)+4 i f^2 \cosh (c+d x)-4 i d^2 e f x \cosh (c+d x)-2 i d^2 f^2 x^2 \cosh (c+d x)+2 d e f \cosh (2 c+d x)+2 d f^2 x \cosh (2 c+d x)+4 i d^2 e^2 \cosh (c+2 d x)-2 i f^2 \cosh (c+2 d x)+8 i d^2 e f x \cosh (c+2 d x)+4 i d^2 f^2 x^2 \cosh (c+2 d x)+8 d^2 e^2 \sinh (d x)-2 f^2 \sinh (d x)+16 d^2 e f x \sinh (d x)+8 d^2 f^2 x^2 \sinh (d x)+d^2 e^2 \sinh (2 (c+d x))-2 f^2 \sinh (2 (c+d x))+2 d^2 e f x \sinh (2 (c+d x))+d^2 f^2 x^2 \sinh (2 (c+d x))+2 f^2 \sinh (2 c+d x)}{\left (\cosh \left (\frac {c}{2}\right )-i \sinh \left (\frac {c}{2}\right )\right ) \left (\cosh \left (\frac {c}{2}\right )+i \sinh \left (\frac {c}{2}\right )\right ) \left (\cosh \left (\frac {1}{2} (c+d x)\right )-i \sinh \left (\frac {1}{2} (c+d x)\right )\right ) \left (\cosh \left (\frac {1}{2} (c+d x)\right )+i \sinh \left (\frac {1}{2} (c+d x)\right )\right )^3}}{12 a d^3} \]

[In]

Integrate[((e + f*x)^2*Sech[c + d*x]^2)/(a + I*a*Sinh[c + d*x]),x]

[Out]

(((10*I)*d*(e + f*x)*(d*(e + f*x) + 2*(1 + I*E^c)*f*Log[1 - I*E^(-c - d*x)]))/(-I + E^c) + (6*(d*(e + f*x)*(d*
(e + f*x) + 2*(1 - I*E^c)*f*Log[1 + I*E^(-c - d*x)]) + (2*I)*(I + E^c)*f^2*PolyLog[2, (-I)*E^(-c - d*x)]))/(-1
 + I*E^c) + 20*f^2*PolyLog[2, I*E^(-c - d*x)] + ((-2*I)*f^2*Cosh[c] + 2*d*f*(e + f*x)*Cosh[d*x] - (2*I)*d^2*e^
2*Cosh[c + d*x] + (4*I)*f^2*Cosh[c + d*x] - (4*I)*d^2*e*f*x*Cosh[c + d*x] - (2*I)*d^2*f^2*x^2*Cosh[c + d*x] +
2*d*e*f*Cosh[2*c + d*x] + 2*d*f^2*x*Cosh[2*c + d*x] + (4*I)*d^2*e^2*Cosh[c + 2*d*x] - (2*I)*f^2*Cosh[c + 2*d*x
] + (8*I)*d^2*e*f*x*Cosh[c + 2*d*x] + (4*I)*d^2*f^2*x^2*Cosh[c + 2*d*x] + 8*d^2*e^2*Sinh[d*x] - 2*f^2*Sinh[d*x
] + 16*d^2*e*f*x*Sinh[d*x] + 8*d^2*f^2*x^2*Sinh[d*x] + d^2*e^2*Sinh[2*(c + d*x)] - 2*f^2*Sinh[2*(c + d*x)] + 2
*d^2*e*f*x*Sinh[2*(c + d*x)] + d^2*f^2*x^2*Sinh[2*(c + d*x)] + 2*f^2*Sinh[2*c + d*x])/((Cosh[c/2] - I*Sinh[c/2
])*(Cosh[c/2] + I*Sinh[c/2])*(Cosh[(c + d*x)/2] - I*Sinh[(c + d*x)/2])*(Cosh[(c + d*x)/2] + I*Sinh[(c + d*x)/2
])^3))/(12*a*d^3)

Maple [A] (verified)

Time = 24.63 (sec) , antiderivative size = 510, normalized size of antiderivative = 1.57

method result size
risch \(\frac {2 i \left (-2 i d^{2} x^{2} f^{2}+4 d^{2} x^{2} f^{2} {\mathrm e}^{d x +c}-d \,f^{2} x \,{\mathrm e}^{3 d x +3 c}-4 i d^{2} e f x +8 d^{2} e f x \,{\mathrm e}^{d x +c}-d e f \,{\mathrm e}^{3 d x +3 c}-2 i d^{2} e^{2}+i f^{2} {\mathrm e}^{2 d x +2 c}+4 d^{2} e^{2} {\mathrm e}^{d x +c}-{\mathrm e}^{d x +c} d \,f^{2} x -f^{2} {\mathrm e}^{3 d x +3 c}-{\mathrm e}^{d x +c} d e f +i f^{2}-f^{2} {\mathrm e}^{d x +c}\right )}{3 \left ({\mathrm e}^{d x +c}+i\right ) \left ({\mathrm e}^{d x +c}-i\right )^{3} d^{3} a}-\frac {5 f^{2} \operatorname {polylog}\left (2, -i {\mathrm e}^{d x +c}\right )}{3 a \,d^{3}}+\frac {4 f^{2} c^{2}}{3 a \,d^{3}}+\frac {2 i f^{2} c \arctan \left ({\mathrm e}^{d x +c}\right )}{3 a \,d^{3}}+\frac {8 f \ln \left ({\mathrm e}^{d x +c}\right ) e}{3 a \,d^{2}}-\frac {5 f^{2} \ln \left (1+i {\mathrm e}^{d x +c}\right ) c}{3 a \,d^{3}}+\frac {4 f^{2} c \ln \left (1+{\mathrm e}^{2 d x +2 c}\right )}{3 d^{3} a}-\frac {8 f^{2} c \ln \left ({\mathrm e}^{d x +c}\right )}{3 a \,d^{3}}-\frac {f^{2} \operatorname {polylog}\left (2, i {\mathrm e}^{d x +c}\right )}{a \,d^{3}}-\frac {f^{2} \ln \left (1-i {\mathrm e}^{d x +c}\right ) x}{a \,d^{2}}-\frac {f^{2} \ln \left (1-i {\mathrm e}^{d x +c}\right ) c}{a \,d^{3}}-\frac {4 f e \ln \left (1+{\mathrm e}^{2 d x +2 c}\right )}{3 a \,d^{2}}+\frac {4 f^{2} x^{2}}{3 a d}-\frac {5 f^{2} \ln \left (1+i {\mathrm e}^{d x +c}\right ) x}{3 a \,d^{2}}+\frac {8 f^{2} c x}{3 a \,d^{2}}-\frac {2 i f e \arctan \left ({\mathrm e}^{d x +c}\right )}{3 a \,d^{2}}\) \(510\)

[In]

int((f*x+e)^2*sech(d*x+c)^2/(a+I*a*sinh(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

2/3*I*(-2*I*d^2*x^2*f^2+4*d^2*x^2*f^2*exp(d*x+c)-d*f^2*x*exp(3*d*x+3*c)-4*I*d^2*e*f*x+8*d^2*e*f*x*exp(d*x+c)-d
*e*f*exp(3*d*x+3*c)-2*I*d^2*e^2+I*f^2*exp(2*d*x+2*c)+4*d^2*e^2*exp(d*x+c)-exp(d*x+c)*d*f^2*x-f^2*exp(3*d*x+3*c
)-exp(d*x+c)*d*e*f+I*f^2-f^2*exp(d*x+c))/(exp(d*x+c)+I)/(exp(d*x+c)-I)^3/d^3/a-5/3*f^2*polylog(2,-I*exp(d*x+c)
)/a/d^3+4/3/a/d^3*f^2*c^2+2/3*I/a/d^3*f^2*c*arctan(exp(d*x+c))+8/3/a/d^2*f*ln(exp(d*x+c))*e-5/3/a/d^3*f^2*ln(1
+I*exp(d*x+c))*c+4/3/d^3/a*f^2*c*ln(1+exp(2*d*x+2*c))-8/3/a/d^3*f^2*c*ln(exp(d*x+c))-f^2*polylog(2,I*exp(d*x+c
))/a/d^3-1/a/d^2*f^2*ln(1-I*exp(d*x+c))*x-1/a/d^3*f^2*ln(1-I*exp(d*x+c))*c-4/3/a/d^2*f*e*ln(1+exp(2*d*x+2*c))+
4/3*f^2*x^2/a/d-5/3/a/d^2*f^2*ln(1+I*exp(d*x+c))*x+8/3/a/d^2*f^2*c*x-2/3*I/a/d^2*f*e*arctan(exp(d*x+c))

Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 714 vs. \(2 (281) = 562\).

Time = 0.25 (sec) , antiderivative size = 714, normalized size of antiderivative = 2.20 \[ \int \frac {(e+f x)^2 \text {sech}^2(c+d x)}{a+i a \sinh (c+d x)} \, dx=\frac {4 \, d^{2} e^{2} - 8 \, c d e f + 2 \, {\left (2 \, c^{2} - 1\right )} f^{2} - 2 \, f^{2} e^{\left (2 \, d x + 2 \, c\right )} - 3 \, {\left (f^{2} e^{\left (4 \, d x + 4 \, c\right )} - 2 i \, f^{2} e^{\left (3 \, d x + 3 \, c\right )} - 2 i \, f^{2} e^{\left (d x + c\right )} - f^{2}\right )} {\rm Li}_2\left (i \, e^{\left (d x + c\right )}\right ) - 5 \, {\left (f^{2} e^{\left (4 \, d x + 4 \, c\right )} - 2 i \, f^{2} e^{\left (3 \, d x + 3 \, c\right )} - 2 i \, f^{2} e^{\left (d x + c\right )} - f^{2}\right )} {\rm Li}_2\left (-i \, e^{\left (d x + c\right )}\right ) + 4 \, {\left (d^{2} f^{2} x^{2} + 2 \, d^{2} e f x + 2 \, c d e f - c^{2} f^{2}\right )} e^{\left (4 \, d x + 4 \, c\right )} - 2 \, {\left (4 i \, d^{2} f^{2} x^{2} + {\left (8 i \, c + i\right )} d e f + {\left (-4 i \, c^{2} + i\right )} f^{2} + {\left (8 i \, d^{2} e f + i \, d f^{2}\right )} x\right )} e^{\left (3 \, d x + 3 \, c\right )} - 2 \, {\left (-4 i \, d^{2} e^{2} + {\left (8 i \, c + i\right )} d e f + i \, d f^{2} x + {\left (-4 i \, c^{2} + i\right )} f^{2}\right )} e^{\left (d x + c\right )} + 3 \, {\left (d e f - c f^{2} - {\left (d e f - c f^{2}\right )} e^{\left (4 \, d x + 4 \, c\right )} - 2 \, {\left (-i \, d e f + i \, c f^{2}\right )} e^{\left (3 \, d x + 3 \, c\right )} - 2 \, {\left (-i \, d e f + i \, c f^{2}\right )} e^{\left (d x + c\right )}\right )} \log \left (e^{\left (d x + c\right )} + i\right ) + 5 \, {\left (d e f - c f^{2} - {\left (d e f - c f^{2}\right )} e^{\left (4 \, d x + 4 \, c\right )} - 2 \, {\left (-i \, d e f + i \, c f^{2}\right )} e^{\left (3 \, d x + 3 \, c\right )} - 2 \, {\left (-i \, d e f + i \, c f^{2}\right )} e^{\left (d x + c\right )}\right )} \log \left (e^{\left (d x + c\right )} - i\right ) + 5 \, {\left (d f^{2} x + c f^{2} - {\left (d f^{2} x + c f^{2}\right )} e^{\left (4 \, d x + 4 \, c\right )} - 2 \, {\left (-i \, d f^{2} x - i \, c f^{2}\right )} e^{\left (3 \, d x + 3 \, c\right )} - 2 \, {\left (-i \, d f^{2} x - i \, c f^{2}\right )} e^{\left (d x + c\right )}\right )} \log \left (i \, e^{\left (d x + c\right )} + 1\right ) + 3 \, {\left (d f^{2} x + c f^{2} - {\left (d f^{2} x + c f^{2}\right )} e^{\left (4 \, d x + 4 \, c\right )} - 2 \, {\left (-i \, d f^{2} x - i \, c f^{2}\right )} e^{\left (3 \, d x + 3 \, c\right )} - 2 \, {\left (-i \, d f^{2} x - i \, c f^{2}\right )} e^{\left (d x + c\right )}\right )} \log \left (-i \, e^{\left (d x + c\right )} + 1\right )}{3 \, {\left (a d^{3} e^{\left (4 \, d x + 4 \, c\right )} - 2 i \, a d^{3} e^{\left (3 \, d x + 3 \, c\right )} - 2 i \, a d^{3} e^{\left (d x + c\right )} - a d^{3}\right )}} \]

[In]

integrate((f*x+e)^2*sech(d*x+c)^2/(a+I*a*sinh(d*x+c)),x, algorithm="fricas")

[Out]

1/3*(4*d^2*e^2 - 8*c*d*e*f + 2*(2*c^2 - 1)*f^2 - 2*f^2*e^(2*d*x + 2*c) - 3*(f^2*e^(4*d*x + 4*c) - 2*I*f^2*e^(3
*d*x + 3*c) - 2*I*f^2*e^(d*x + c) - f^2)*dilog(I*e^(d*x + c)) - 5*(f^2*e^(4*d*x + 4*c) - 2*I*f^2*e^(3*d*x + 3*
c) - 2*I*f^2*e^(d*x + c) - f^2)*dilog(-I*e^(d*x + c)) + 4*(d^2*f^2*x^2 + 2*d^2*e*f*x + 2*c*d*e*f - c^2*f^2)*e^
(4*d*x + 4*c) - 2*(4*I*d^2*f^2*x^2 + (8*I*c + I)*d*e*f + (-4*I*c^2 + I)*f^2 + (8*I*d^2*e*f + I*d*f^2)*x)*e^(3*
d*x + 3*c) - 2*(-4*I*d^2*e^2 + (8*I*c + I)*d*e*f + I*d*f^2*x + (-4*I*c^2 + I)*f^2)*e^(d*x + c) + 3*(d*e*f - c*
f^2 - (d*e*f - c*f^2)*e^(4*d*x + 4*c) - 2*(-I*d*e*f + I*c*f^2)*e^(3*d*x + 3*c) - 2*(-I*d*e*f + I*c*f^2)*e^(d*x
 + c))*log(e^(d*x + c) + I) + 5*(d*e*f - c*f^2 - (d*e*f - c*f^2)*e^(4*d*x + 4*c) - 2*(-I*d*e*f + I*c*f^2)*e^(3
*d*x + 3*c) - 2*(-I*d*e*f + I*c*f^2)*e^(d*x + c))*log(e^(d*x + c) - I) + 5*(d*f^2*x + c*f^2 - (d*f^2*x + c*f^2
)*e^(4*d*x + 4*c) - 2*(-I*d*f^2*x - I*c*f^2)*e^(3*d*x + 3*c) - 2*(-I*d*f^2*x - I*c*f^2)*e^(d*x + c))*log(I*e^(
d*x + c) + 1) + 3*(d*f^2*x + c*f^2 - (d*f^2*x + c*f^2)*e^(4*d*x + 4*c) - 2*(-I*d*f^2*x - I*c*f^2)*e^(3*d*x + 3
*c) - 2*(-I*d*f^2*x - I*c*f^2)*e^(d*x + c))*log(-I*e^(d*x + c) + 1))/(a*d^3*e^(4*d*x + 4*c) - 2*I*a*d^3*e^(3*d
*x + 3*c) - 2*I*a*d^3*e^(d*x + c) - a*d^3)

Sympy [F]

\[ \int \frac {(e+f x)^2 \text {sech}^2(c+d x)}{a+i a \sinh (c+d x)} \, dx=- \frac {i \left (\int \frac {e^{2} \operatorname {sech}^{2}{\left (c + d x \right )}}{\sinh {\left (c + d x \right )} - i}\, dx + \int \frac {f^{2} x^{2} \operatorname {sech}^{2}{\left (c + d x \right )}}{\sinh {\left (c + d x \right )} - i}\, dx + \int \frac {2 e f x \operatorname {sech}^{2}{\left (c + d x \right )}}{\sinh {\left (c + d x \right )} - i}\, dx\right )}{a} \]

[In]

integrate((f*x+e)**2*sech(d*x+c)**2/(a+I*a*sinh(d*x+c)),x)

[Out]

-I*(Integral(e**2*sech(c + d*x)**2/(sinh(c + d*x) - I), x) + Integral(f**2*x**2*sech(c + d*x)**2/(sinh(c + d*x
) - I), x) + Integral(2*e*f*x*sech(c + d*x)**2/(sinh(c + d*x) - I), x))/a

Maxima [F]

\[ \int \frac {(e+f x)^2 \text {sech}^2(c+d x)}{a+i a \sinh (c+d x)} \, dx=\int { \frac {{\left (f x + e\right )}^{2} \operatorname {sech}\left (d x + c\right )^{2}}{i \, a \sinh \left (d x + c\right ) + a} \,d x } \]

[In]

integrate((f*x+e)^2*sech(d*x+c)^2/(a+I*a*sinh(d*x+c)),x, algorithm="maxima")

[Out]

4*f^2*((2*I*d^2*x^2 + (d*x*e^(3*c) + e^(3*c))*e^(3*d*x) - (4*d^2*x^2*e^c - d*x*e^c - e^c)*e^(d*x) - I*e^(2*d*x
 + 2*c) - I)/(6*I*a*d^3*e^(4*d*x + 4*c) + 12*a*d^3*e^(3*d*x + 3*c) + 12*a*d^3*e^(d*x + c) - 6*I*a*d^3) + I*int
egrate(1/4*x/(a*d*e^(d*x + c) + I*a*d), x) - 5*I*integrate(1/12*x/(a*d*e^(d*x + c) - I*a*d), x)) + 1/3*e*f*(24
*(4*I*d*x*e^(4*d*x + 4*c) + (8*d*x*e^(3*c) + e^(3*c))*e^(3*d*x) + e^(d*x + c))/(12*I*a*d^2*e^(4*d*x + 4*c) + 2
4*a*d^2*e^(3*d*x + 3*c) + 24*a*d^2*e^(d*x + c) - 12*I*a*d^2) - 3*log((e^(d*x + c) + I)*e^(-c))/(a*d^2) - 5*log
(-I*(I*e^(d*x + c) + 1)*e^(-c))/(a*d^2)) + 4/3*e^2*(2*e^(-d*x - c)/((2*a*e^(-d*x - c) + 2*a*e^(-3*d*x - 3*c) -
 I*a*e^(-4*d*x - 4*c) + I*a)*d) + I/((2*a*e^(-d*x - c) + 2*a*e^(-3*d*x - 3*c) - I*a*e^(-4*d*x - 4*c) + I*a)*d)
)

Giac [F]

\[ \int \frac {(e+f x)^2 \text {sech}^2(c+d x)}{a+i a \sinh (c+d x)} \, dx=\int { \frac {{\left (f x + e\right )}^{2} \operatorname {sech}\left (d x + c\right )^{2}}{i \, a \sinh \left (d x + c\right ) + a} \,d x } \]

[In]

integrate((f*x+e)^2*sech(d*x+c)^2/(a+I*a*sinh(d*x+c)),x, algorithm="giac")

[Out]

integrate((f*x + e)^2*sech(d*x + c)^2/(I*a*sinh(d*x + c) + a), x)

Mupad [F(-1)]

Timed out. \[ \int \frac {(e+f x)^2 \text {sech}^2(c+d x)}{a+i a \sinh (c+d x)} \, dx=\int \frac {{\left (e+f\,x\right )}^2}{{\mathrm {cosh}\left (c+d\,x\right )}^2\,\left (a+a\,\mathrm {sinh}\left (c+d\,x\right )\,1{}\mathrm {i}\right )} \,d x \]

[In]

int((e + f*x)^2/(cosh(c + d*x)^2*(a + a*sinh(c + d*x)*1i)),x)

[Out]

int((e + f*x)^2/(cosh(c + d*x)^2*(a + a*sinh(c + d*x)*1i)), x)